<template>
  <div>
    <p>你要几个饺子：{{count}}</p>
    <button v-on:click="count=count+1">+</button>
    <button v-on:click='addFn'>+2</button>
    <button v-on:click='addSum(5)'>+5</button>
    <button @click='subFn'>-</button>
  </div>
</template>

<script>
export default {
  data(){
    return{
      count:1
    }
  },
  methods:{
    addFn(){
      this.count+=2
    },
    addSum(num){
      this.count=this.count+num
    },
    subFn(){
      this.count--
    }
  }
}
</script>

<style>

</style>